import os

import yaml

import settings


class YamlFileUtil:
    """
        yaml文件处理工具
    """
    def get_yaml_Data(self, file_path: str) -> list:
        """读取yaml文件数据, 返回dict类型"""
        full_yaml_file_path = os.path.join(settings.PROJECT_PATH, "testcase", "test_pet_manager")
        full_yaml_file_path = full_yaml_file_path + file_path
        with open(full_yaml_file_path, "r", encoding="utf-8") as file:
            yaml_data_dict = yaml.safe_load(file)
        return yaml_data_dict
    

yaml_util = YamlFileUtil()


